//
// Created by v on 24-12-7.
//
#include <iostream>
#include <getopt.h>

#include "rt_print.h"
#include "SnakyMediaRun.h"

int main(int argc, char **args)
{
    int c = -1;
    char *app_config_name = NULL;
    char *app_log_file = "./snakyrun.log";
    while ((c = getopt(argc, args, "c:l:")) != -1)
    {
        switch (c)
        {
        case 'c':
            app_config_name = optarg;
            break;
        case 'l':
            app_log_file = optarg;
            break;
        }
    }

    rt_print_init(RT_PRINT_ALL, RT_PRINT_STYLE_ALL, 1, "snakyrun");
    rt_print_set_log_file(app_log_file);
    rt_print_init_file_conf(app_log_file, "snakyrun");
    rtinfo("Program start %s:%s, app_config [%s]\n", __DATE__, __TIME__, app_config_name);

    SnakyMediaRun mediaRun(app_config_name);
    mediaRun.runUntil();
    rtinfo("exited...");
    return 0;
}